package pl.edu.agh.jemo.evolution.genotype;

/**
 * Interface holding value of specimen genotype.
 * One instance of object implementing that interface is responsible for genotype on one dimension.
 * 
 * @author Marcin Zbijowski
 */
public interface Genotype extends Comparable<Genotype>, Cloneable {
// Dev: Byte array genotype implementation? BigDecimal genotype?
	/**
	 * Returns value of genotype as Double.
	 * 
	 * @return Value of genotype casted to Double
	 */
	public Double asDouble();
	
	/**
	 * Sets value of genotype based on parameter.
	 * 
	 * @param value New specimen genotype value in Double format
	 */
	public void fromDouble(Double value);
	
	/**
	 * Generates random specimen genotype value based on given boundaries.
	 * 
	 * @param lower Lowest possible value of new genotype (inclusive)
	 * @param upper	Highest possible value of new genotype (exclusive)
	 */
	public void generateValue(Double lower, Double upper);
	
	/**
	 * Generates random specimen genotype value based on given boundaries.
	 * 
	 * @param boundaries Array of two elements, were first is treated as lower and second as higher boundary
	 * @see #generateValue(Double, Double)
	 */
	public void generateValue(Double[] boundaries);
	
	/**
	 * Method for creating new instance of genotype, holding the same value.
	 * 
	 * @return new instance of Genotype implementation.
	 */
	public Genotype clone();
}
